package com.devin.avatar.common.entity;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlTransient;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import com.fasterxml.jackson.annotation.JsonIgnore;

public abstract class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 删除标记（0：正常；1：删除；2：审核；）
     */
    public static final String DEL_FLAG_NORMAL = "0";
    public static final String DEL_FLAG_DELETE = "1";

    /**
     * 当前查询参数
     */
    protected RequestParams requstParams;

    @JsonIgnore
    @XmlTransient
    public RequestParams getRequstParams() {
        return requstParams;
    }

    public void setRequstParams(RequestParams requstParams) {
        this.requstParams = requstParams;
    }

    /**
     * 插入之前执行方法，子类实现
     */
    public abstract void preInsert();

    /**
     * 更新之前执行方法，子类实现
     */
    public abstract void preUpdate();

    @Override
    public String toString() {
	return ReflectionToStringBuilder.toString(this);
    }
}
